<script type="text/javascript">
	var counter = 0;
	
	function emptyText(){
		var el = document.getElementById('newstr');
		if(counter == 0 && (el.innerHTML == "Input translated text here")){
			el.innerHTML = "";
		}
		counter++;
	}
	var cb = function(req, json) {
		if (json.ok === false) {
			var win = new FloatingWindow({initContent: "<strong>Submitting...</strong>"});
			win.show({useFadeEffect: true, title: json.title, content: json.content});
		} else {
			$("translation_form").submit();
		}
	}

	function post_data() {
		new Ajax.Request('/go/babel/ajax/translate', {
				method: 'post',
				parameters: "str=" + String($("newstr").value).replace("#", "%23"),
				onComplete: cb,
		});
		return false;
	}
	function post_reason() {
		new Ajax.Request('/go/babel/ajax/vote', {
				method: 'post',
				parameters: "reason=" + String($("reason").value).replace("#", "%23"),
				onComplete: cb,
		});
		return false;
	}

	
</script>

<div align="left" name="div_translation" id="babel_task">

	<form name="translation_form" id="translation_form" method="POST" action="" onsubmit="return false;">

	<div id="task_submitted">
		{VAR_TASK_SUBMITTED}<br />
	</div>
	<!-- Change the colors to more appropriate colors! -->
	
	<!-- BEGIN task_reason -->
	<div id="task_reason" class="info">
		<input type="hidden" name="old_const_id" value="{VAR_OLD_CONSTANT_ID}" />
		<select name="reason">
			<option value="0">Please choose reason</option>
			<!-- BEGIN task_reason_option -->
			<option value="{VAR_REASON_VALUE}">{VAR_REASON_TEXT}</option>
			<!-- END task_reason_option -->
		</select>
		<input type="submit" name="verify" value="Submit" />
	</div>
	<!-- END task_reason -->
	
	<table>
		<h3>Translation</h3><br><br>
		<colgroup align="left">
			<col width="400" />
			<col width="400" />
		</colgroup>
		<thead>
			<tr>
				<th bgcolor="#DDDDDD"" colspan="2"><strong>More info:</strong></th>
			</tr>
		</thead>
		<tbody>
			<tr bgcolor="#EEEEEE">
				<td>Context: {VAR_CONTEXT}</td>
				<td>Translating to: <b>{VAR_LANG_NAME}</b></td>
			</tr>
		</tbody>
		<tbody>
			<tr bgcolor="#DDDDDD"">
				<td><strong>Original text (in English):</strong></td>
				<td><strong>Submit your suggestion or click "OK" to vote:</strong></td>
			</tr>
			<tr>
				<td valign="top">{VAR_TRANSLATION_TEXT}</td>
				<td><textarea onclick="emptyText();" style="background-color: FFFFDD" id="newstr" name="newstr" rows="10" cols="40" class="styledfield">{VAR_SUGGESTION}</textarea></td>
			</tr>
		</tbody>
		<tbody>
			<tr>
				<td colspan="2" align="right"><input class="btn-skip" type="submit" name="btn_skip" value="Skip/Next" onclick="this.form.submit();"><input class="btn-save" type="submit" name="btn_sub"  value="OK" onclick="post_data(); return false;"></td>
			</tr>
		</tbody>
		<tfoot>
			<tr>
				<td bgcolor="#DDDDDD" colspan="2"><strong>Changelog</strong></td>	
			</tr>
			<!-- BEGIN changelog -->
			<tr>
				<td>Changed</td>
				<td>{VAR_CHANGED_VALUE}</td>
			</tr>
			<!-- END changelog -->
		</tfoot>
	</table>
	</form>
</div>

